<include file="Public:head" title="服务列表"/>

<div class="main-container" id="main-container">
    <div class="main-container-inner">
        <include file="Public:left" />
        <div class="main-content">
            <div class="breadcrumbs" id="breadcrumbs">
                <ul class="breadcrumb">
                    <li><i class="icon-home home-icon"></i><a href="__APP__/{$Think.MODULE_NAME}">首页</a></li>
                    <li><a href="{:U('Service/lists')}">服务管理</a></li>
                    <li class="active">服务列表</li>
                </ul>
            </div>
            <div class="page-content">
                <div class="row">
                    <div class="col-xs-12">
                        <div class="row">
                            <div class="col-xs-12">
                                <div class="header smaller lighter blue">
                                    <div class="nav-search col-xs-10" id="nav-search">
                                        <form class="form-search" method="get">
                                            <div class="search_area">
                                             
                                              
                                               <select name="is_check" autocomplete="off">
                                                    <option value="">请选择是否开启</option>
                                              <option value="0"<if condition="$is_check eq 0 && $is_check neq ''">selected</if>>否</option>
                                                           <option value="1"<if condition="$is_check eq 1">selected</if>>是</option>
                                            </select>
                                                <input class="form-control search-query" type="text" name="keyword" autocomplete="off"  placeholder="请输入服务名称" value="{$Think.get.keyword}">
                                                <button class="btn btn-purple btn-sm" type="submit">搜 索 <i class="icon_search icon-on-right bigger-110"></i></button>
                                            </div>
                                        </form>
                                    </div>
                                    <div class='cl'></div>
                                </div>
                                <notempty name='orderlist'>
                                    <div class="table-responsive">
                                        <table id="sample-table-1" class="table table-striped table-bordered table-hover">
                                            <thead>
                                                <tr>
                                                    <th width='45px' class="center">ID</th>
                                                    <th>订单编号</th>
                                                    <th>服务名称</th>
                                                    <th>套餐名称</th>
                                                    <th>套餐价格</th>
                                                    <th>订单用户</th>
                                                    <th>订单金额</th>
                                                    <th>第三方交易号</th>
                                                    <th>支付类型</th>
<!--                                                    <th>处理人</th>-->
<!--                                                    <th>完成时间</th>-->
                                                    <th>订单创建时间</th>
                                                    <th>订单支付时间</th>
                                                    <th>支付状态</th>
<!--                                                    <th>处理状态</th>-->
<!--                                                    <th>操作</th>-->
                                                </tr>
                                            </thead>
                                            <tbody>
                                            <foreach name="orderlist" item="row">
                                                <tr>
                                                    <td class="center">{$row.id}</td>
                                                    <td>{$row.order_no}</td>
                                                    <td>{$row.title|msubstr=0,32,'utf-8',true}</td>
                                                    <td>{$row.name}</td>
                                                    <td>{$row.price}</td>
                                                       <td> <a href="{:U('User/detail',array('id'=>$row['uid']))}" target="_blank">{$row.uid|getUserName}</a></td>
                                                    <td>{$row.order_money}</td>
                                                    <td>{$row.trade_no}</td>
                                                    <td>{$row.pay_type|paytype}</td>
<!--                                                    <td onclick="setperson('{$row.id}')" style="color: #b3ad0d;cursor: pointer">{$row.do_linkman}</td>-->
<!--                                                    <td>{$row.do_finish_time|date="m-d H:i",###}</td>-->
                                                    <td>{$row.addtime|date="Y-m-d H:i",###}</td>
                                                    <td>{$row.time_pay|date="Y-m-d H:i",###}</td>
                                                    <td><if condition="$row.status eq 1"><span style="color:green">已支付</span><else/>未支付</if></td>
<!--                                                    <td>{$row.do_status|operation}</td>-->
<!--                                                    <td class="op">
                                                        <span style="color: #b3ad0d;margin-left: 10px;" onclick="orderdostatus('{$row.id}',0)">待审核</span>
                                                        <span style="color: #0b18b3;margin-left: 10px" onclick="orderdostatus('{$row.id}',1)">进行中</span>
                                                        <span style="color: #b3003e;margin-left: 10px" onclick="orderdostatus('{$row.id}',2)">已完成</span>
                                                        <span style="color: #00b33b;margin-left: 10px" onclick="orderdostatus('{$row.id}',3)">拒绝</span>
                                                    </td>-->
                                                </tr>
                                            </foreach>
                                            </tbody>
                                        </table>
                                    </div>
                                    <else/>
                                    <p class='noempty'>没有符合条件的记录！</p>
                                </notempty>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <include file="Public:setting" />
    </div>
    <script src="__PUBLIC__/plugins/layer/layer.js"></script>
    <script>
        function yesstatus(id, table, field) {
            $.post(getUrl("Ajax/yes"), {
                id: id,
                table: table,
                field: field
            }, function(data) {
                if (data == "是") {
                    $('#' + field + '_' + id).html("<a onclick=yesstatus(" + id + ",'" + table + "','" + field + "')>" + data + "</a>");
                } else {
                    $('#' + field + '_' + id).html("<a onclick=yesstatus(" + id + ",'" + table + "','" + field + "')><span style='color:red'>" + data + "</span></a>");
                }
            })
        }
        function setperson(id) {
            var info = "";
            layer.prompt({title: '请输入处理人', formType: 3}, function(name, index){
                layer.close(index);
                layer.prompt({title: '请填写联系qq，并确认', formType: 2}, function(qq, index){
                    layer.close(index);
                    info = name + '-' + qq;
                    processing_person(id,info)
                });
            });

        }
        function processing_person(id,info) {
            $.post("{:U('Service/update_processing_person')}", {
                id: id,
                do_linkman: info,
            }, function(data) {
                if(data.code == 200 ){
                    layer.open({
                        content: '处理人设置成功'
                        ,skin: 'msg'
                        ,time: 3000//2秒后自动关闭
                        ,end: function () {
                            window.location.reload()
                        }
                    });
                }else{
                    layer.alert('处理人设置失败', {
                        icon: 2,
                        skin: 'layer-ext-moon'
                    })
                }
            });
        }
        function orderdostatus(id,orderdostatus) {
            $.post("{:U('Service/orderdostatus')}", {
                id: id,
                do_status: orderdostatus,
            }, function(data) {
                if(data.code == 200 ){
                    layer.open({
                        content: '状态修改成功'
                        ,skin: 'msg'
                        ,time: 3000//2秒后自动关闭
                        ,end: function () {
                            window.location.reload()
                        }
                    });
                }else{
                    layer.alert('状态修改失败', {
                        icon: 2,
                        skin: 'layer-ext-moon'
                    })
                }
            })
        }

    </script>
</div>
<style>
    .op span{
        cursor: pointer;
    }
</style>
<include file="Public:state" />
<include file="Public:foot" />